import request from '/@/utils/request';

export function authorityApi() {
    return {
        // 获取权限列表
        getPermissionList: (params: object) => {
            return request({
                url: '/api/admin/system/permissions',
                method: 'get',
                params
            });
        },
        // 获取日志列表
        getLogs: (params: object) => {
            return request({
                url: '/api/admin/system/logs',
                method: 'get',
                params
            });
        },
        // 获取权限详情
        getPermissionDetail: (params: object) => {
            return request({
                url: '/api/admin/system/permission',
                method: 'get',
                params
            });
        },
        // 创建权限
        createPermission: (data: object) => {
            return request({
                url: '/api/admin/system/permission',
                method: 'post',
                data
            });
        },
        // 编辑权限
        updatePermission: (data: object) => {
            return request({
                url: '/api/admin/system/permission',
                method: 'put',
                data
            });
        },
        // 删除权限
        deletePermission: (data: object) => {
            return request({
                url: '/api/admin/system/permission',
                method: 'delete',
                data
            });
        },

    }
}